home *** CD-ROM | disk | FTP | other *** search
/ Larry Magid's Essential Internet / Larry Magid's Essential Internet (Quarterdeck Corporation)(1995).ISO / qsockpro.qip / KAIWAN.MPS < prev    next >
Text File  |  1995-10-09  |  3KB  |  80 lines

  1. # Quarterdeck DFW Internet Services PPP Script
  2.  
  3. # Always place a comment as the first line with the name of the provider
  4. # and the type of connection.  We will attempt to display this in the 
  5. # script file requestor to aid the user in selecting an appropriate 
  6. # script since the filename may not be sufficient.
  7.  
  8. #define the variables we will need
  9.  
  10. STRING username
  11. STRING password
  12. STRING framing
  13. STRING IPAddress
  14.  
  15. # uncomment for debugging
  16. # TRACE ON
  17.  
  18. # reset maximum login timeout.  We put this here in case it took an
  19. # unusually long amount of time to get the initial connection.    Its
  20. # probably too long but its better to be safe than sorry.
  21.  
  22. SetTimeout 90
  23.  
  24. # Get username from access method
  25. # NOTE: Some systems do not require a username.
  26. # This step will not be necessary in those cases.
  27. # if the Username field is empty, prompt the user for it.
  28. CfgGetValue "Username" username
  29. IF result = 0 THEN
  30.     GetInput "Enter your user name" username
  31.     IF result = 0 THEN
  32.         PRINT "Warning, no username entered"
  33.     THEN
  34.         PRINT "Username set to ["; username; "]"
  35.     ENDIF
  36. ENDIF
  37.  
  38. # get password from access method
  39. # NOTE: Some systems do not require a password.
  40. # This step will not be necessary in those cases.
  41. # if the Password field is empty, prompt the user for it.
  42. CfgGetValue "Password" password
  43. IF result = 0 THEN
  44.     GetPassword "Enter your password" password
  45.     IF result = 0 THEN
  46.         PRINT "Warning, no password entered"
  47.     THEN
  48.         # NOTE: Don't print password.
  49.         PRINT "Password set."
  50.     ENDIF
  51. ENDIF
  52.  
  53. CfgGetValue "Framing" framing    # get framing layer (MPPPP, MPSLIP)
  54.  
  55. IF result = 0 THEN
  56.     # abort with an error if we can't read the Framing setting
  57.     ABORT "Can't read 'Framing' setting from qdeck.ini"
  58. ENDIF
  59.  
  60. CommWaitFor "ogin:"             # wait for login prompt
  61.     CommSend username            # send user name
  62.     CommSend "%r"                # send carriage return
  63.  
  64. CommWaitFor "assword:"          # wait for password prompt
  65.     CommSend password            # send password
  66.     CommSend "%r"                # send carriage return
  67.  
  68. IF framing = "MPSLIP" THEN        # if SLIP, we need to  get the IP address
  69.     PRINT "Getting IP address for SLIP"
  70.     CommWaitFor ") to"          # wait for string that precedes the reported
  71.                                 # IP Address
  72.     CommReadIPAddr IPAddress    # IP address should be next word
  73.  
  74.     # store the IP address
  75.     CfgSetValue "IPAddress" IPaddress
  76.     PRINT "IP Address set to ["; IPAddress; "]"
  77. ENDIF                            # end of SLIP logic
  78.  
  79. END                              # indicate success if we got this far
  80.